#!/usr/bin/env python
# -*- coding:utf-8 -*-
'''
    应用程序Python插件加载入口
'''

import sys
print("Loading Python...")
print(sys.version)
from EventBus import *

def router(data:dict):
    print("Python路由...")
    context = EventContext()
    context.name = data.get('name', None)
    context.data = data
    appEventBus(context.name, context)
    # print(context.get('a', None))
    # context['result'] = 0
    # context['data'] = 25

def main():
    '''注册'''
    print('注册事件')
    appEventBus.bind('*', log_handler)

def log_handler(context, *args, **kwargs):
    print(context, args, kwargs)

main()
